<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div{
            width: 150px;
            height: 200px;
            background-color: green;
            border: 1px solid red;
        }
        .container{
            height: 450px;
            /* container容器对外变现成一个行内元素 */
            display: inline-flex;
            /* 定义主轴的方向 */
            flex-direction: row-reverse;
            /* 屏幕不够大的时候项目如何换行  wrap-reserve 第一行在下面*/
            flex-wrap: wrap;
            /* flex-flow 是 flex-direction 和flex-wrap的简写 */
            flex-flow: wrap-reverse row;
            /* justify-content 定义项目在主轴上面的对齐方式 */
            justify-content: space-around;
            /* align-items 项目在交叉轴的对齐方式 */
            align-items: baseline;
            /* 有多行的时候  每一行的对齐方式 */
            align-content: space-around;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="div">1</div>
        <div class="div">2</div>
        <div class="div">3</div>
        <div class="div">4</div>
        <div class="div">5</div>
        <div class="div">6</div>
        <div class="div">7</div>
        <div class="div">8</div>
        <div class="div">9</div>
        <div class="div">10</div>
        <div class="div">11</div>
        <div class="div">12</div>
        <div class="div">13</div>
        <div class="div">14</div>
        <div class="div">15</div>
        <div class="div">16</div>
        <div class="div">17</div>
        <div class="div">18</div>
        <div class="div">19</div>
        <div class="div">20</div>
    </div>
</body>

</html>